const http = require("http");
const { URL } = require("url");

http.createServer((req, res) => {
    let urlObj = new URL(req.url, "http://localhost:3000");
    let username = urlObj.searchParams.get("username");
    let age = urlObj.searchParams.get("age");
    let statusObj = { username: username, age: age };
    res.end(JSON.stringify(statusObj));
}).listen(3000)

console.log("server is listening 3000");